package com.ctshk.common.enums.order;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * @author 谢诗宏
 * @description 订单销售方式类型
 * @date 2021/3/11
 */
@AllArgsConstructor
public enum OrderSalesMethods {

    // 销售方式
    SINGLE(1, "單品銷售"),
    PACKAGING(2, "打包銷售"),
    ;

    @Getter
    @Setter
    private int code;

    @Getter
    @Setter
    private String value;

    public static String parseValue(int code){
        for (OrderSalesMethods type : OrderSalesMethods.values()) {
            if (type.code == code) {
                return type.getValue();
            }
        }
        return null;
    }
}
